package com.heima.listener;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class HelloListener {

    @KafkaListener(topics = "itcast-topic",groupId = "group101")
    public void onMessage(String message){
        System.out.println("消费者1");
        System.out.println(message);
        }
    @KafkaListener(topics = "itcast-topic",groupId = "group102")
    public void onMessage2(String message){
        System.out.println("消费者2");
        System.out.println(message);
    }
}